<?php
/**
 * Created by PhpStorm.
 * User: TS
 * Date: 2017/4/4
 * Time: 17:09
 */
namespace core;

class Error {

    /**
     * 注册异常处理
     * @return void
     */
    public static function register()
    {
        error_reporting(E_ALL);
        set_error_handler([__CLASS__, 'appError']);
        set_exception_handler([__CLASS__, 'appException']);
        register_shutdown_function([__CLASS__, 'appShutdown']);
    }

    public static function appError()
    {
        echo 1;
    }

    public static function appShutdown()
    {
        echo 2;
    }

    public static function appException()
    {
        echo 3;
    }
}